package sdau.hjk.controller;

import sdau.hjk.entity.UserReport;
import sdau.hjk.service.Impl.UserReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.ParseException;
import java.util.List;

/**
 *@version 1.0
 *@author: huangjiakai
 *@create:2021−02-22 14:02
 *@className:com.hjk.controller.UserReportController
 *@description: TODO
 */
@Controller
@RequestMapping("/userReport")
public class UserReportController {
    @Autowired
    private UserReportService userReportService;

    @RequestMapping("/findById")
    @ResponseBody
    public List<UserReport> findById(Integer id){
        List<UserReport> userReportList = userReportService.findById(id);
        return userReportList;
    }

    @RequestMapping("/save")
    public void save(UserReport userReport) throws ParseException {
        userReportService.saveUserReport(userReport);
    }
}
